// curry

// ES 5
function curry (fn, currArgs) {
  
  return function () {
    let args = [].slice.call(arguments)

    //拼接参数
    if (currArgs !== undefined) {
      args = args.concat(currArgs)
    }

    if (args.length < fn.length) {
      return curry(fn, args)
    } else {
      return fn.apply(null, args)
    }
  }
}


const curry = (fn,...args) => 
  args.length >= fn.length ? fn(...args) : (..._args)=>curry(fn,...args,..._args)

